A plurality of hosts may be in communication over a physical network infrastructure, each host having one or more virtualized endpoints such as virtual machines (VMs) or containers that are part of a network. Certain aspects described may be discussed with respect to VMs, however, it should be understood that such aspects can also be applied to other virtual computing instances (e.g., virtual machines (VMs), containers (e.g., Docker containers), data compute nodes, isolated user space instances, etc.). In hosting VMs, a host machine may provide a virtual switch that connects virtual machines running on the host to communicate with other VMs hosted on the same host machine as well as VMs hosted on other hosts.
In certain aspects, the network is a layer-2 (L2) network where frames (e.g., a data frame, a packet, etc.) are forwarded (e.g., by virtual switches) based on a destination media access control (MAC) address included in the frame. The term “layer-2” generally refers to a data link layer (e.g., MAC or Ethernet layer), “layer-3” to a network layer (e.g., IP layer), and “layer-4” to a transport layer (e.g., Transmission Control Protocol (TCP) layer) in the OSI model, although the concepts described herein and referred to simply as “L2” or “MAC” and “L3” or “IP” may be applicable to corresponding layers in other networking models.
Accordingly, in certain aspects, for a source virtual machine to send a frame to a destination virtual machine, the source virtual machine includes a destination MAC address of the destination virtual machine in a header of the frame. Accordingly, if the source virtual machine does not have a destination MAC address but rather only a destination IP address of the destination virtual machine, a source virtual machine may need to convert the IP address to a MAC address. The source virtual machine may use Address Resolution Protocol (ARP) to determine the MAC address of the destination virtual machine. When a source virtual machine wants to send data, the virtual machine searches its ARP cache to try to determine the MAC address corresponding to the destination IP address of the destination virtual machine. If the source virtual machine is unable find such an entry, an ARP request packet may be broadcasted to all the machines in the network to resolve the destination IP address. After the destination virtual machine receives the ARP request packet, it may send back an ARP reply packet with its MAC address. The two virtual machines may then begin communicating with each other.